package com.tangyuan.user.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tangyuan.common.result.Result;
import com.tangyuan.dto.UserActionByUserIdDto;
import com.tangyuan.dto.UserActionDto;
import com.tangyuan.model.UserAction;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 小梁
 * @since 2020-12-03
 */
public interface UserActionService extends IService<UserAction> {

    int updateUserAction(UserActionDto dto);


    /**
     * 用户行为插入
     */
    int addUserAction(Long userId,Long movieId);

    /**
     * 得到所有用户行为的集合
     * @return
     */
    List<UserAction> getUserActionCollection();

    /**
     * 得到所有用户有过行为的电影的不重复id
     * @return
     */
    List<Long> getAllUserMovieId();

    /**
     * 得到所有有过行为的用户id
     * @return
     */
    List<Long> getAllUserId();

    void view(UserAction userAction);

    Result<String> action(UserActionDto dto);

    void deleteUserAction();

    List<UserAction> selectUserActionList(Long userId,String sort);

    List<UserAction> selectUserActionListByDistinct();

    List<UserAction> getYesterdayUserActionData(Date time);

    List<Long> getUserActionByUserIdDto(UserActionByUserIdDto userActionByUserIdDto);

    List<Long> getUserActionByUserId(Long userId);

    Page<UserAction> getPageUserActionByUserId(Long userId, Integer pageNum, Integer pageSize);
}
